package zuoye;

import java.util.Scanner;

public class First {
	public static void main(String[] args){
		int a;
		int n;
		int x=0;
		Scanner sacnner=new Scanner(System.in);
		a=sacnner.nextInt();
		while (a!=0){
			n=a%10;
			a=a/10;
			x=x+n;
		}
		System.out.println(x);
	}
}
